package edu.uniquindio.prmaven.proyectofinal;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import edu.uniquindio.prmaven.general.TestCore;

public class InputMask_1 extends TestCore {
	
	@Test()
	/**
	dataProviderClass = edu.uniquindio.prmaven.dataprovider.DataProviderFactory.class, 
	dataProvider = ConfigurationConstants.DP_FACTORY
	@DataProviderArguments(ConfigurationConstants.ESCENARIO
			+ ConfigurationConstants.EQUALS + DataProvidersConstants.HOJA_1)
			**/
	
	public void testInputMask_1() throws Exception {
		
		try {
			
		selenium.open("/showcase/");
		
		//selenium.click("id=SubMenu-Input"); Seleccionar menu Input
		WebElement menuInput=driver.findElement(By.id("SubMenu-Input"));
		menuInput.click();
		
		//selenium.click("link=• InputMask");Seleccionar Submenu InputMask 
		//.//*[@id='MENUSIDEindent']/div[3]/a[10]
		WebElement submenuInputMask=driver.findElement(By.xpath
				("//*[@id='MENUSIDEindent']/div[3]/a[10]"));
		submenuInputMask.click();
		
		selenium.waitForPageToLoad("30000");
		
		//xpath .//*[@id='j_idt88:key']
		
		WebElement campoProducK=driver.findElement(By.xpath("//*[@id='j_idt88:key']"));
		campoProducK.click();
		
		WebElement ingresarTex=driver.findElement(By.xpath("//*[@id='j_idt88:key']"));
		ingresarTex.sendKeys("df-222-e456");
		
	
		//selenium.click("id=j_idt88:j_idt97"); xpath..//*[@id='j_idt88:j_idt97']
		WebElement botonSubmit=driver.findElement(By.xpath("//*[@id='j_idt88:j_idt97']"));
		botonSubmit.click();
		
		Assert.assertEquals(selenium.getText("css=div.ui-dialog-content.ui-widget-content"), 
				"Date: Phone: Phone with Ext: taxId: SSN: Product Key: df-222-e456");
		
		//selenium.click("//div[@id='j_idt88:j_idt98']/div/a");
		WebElement cerrar=driver.findElement(By.xpath("//div[@id='j_idt88:j_idt98']/div/a"));
		cerrar.click();
		
	}catch(AssertionError e){
		System.out.println("no se encontro texto");
	}finally{
		
	}
}

}


